
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/students',
    name: 'students',
    component:()=>import('../views/student/StuView.vue'),
    meta:{requiresAuth:true}
  },
  {
    path: '/:deptId/score',
    name: 'classScore',
    component:()=>import('../views/student/ClassScoreView.vue')
},
{
  path: '/:deptId/students',
  name: 'classStudents',
  component:()=>import('../views/student/ClassStudentView.vue')
},
  {
    path:'/classStudent',
    name:'classStudent',
    import:()=>('../views/student/ClassStuView.vue'),
    meta:{requiresAuth:true}
  },
  {
    path: '/',
    name: 'Login',
    component:()=>import('../views/login/LoginVue.vue')
  },
  {
    path: '/score',
    name: 'score',
    component: () => import(/* webpackChunkName: "about" */ '../views/student/ScoreView.vue')
  },
  // {
  //   path: '/',
  //   redirect: '/students'
  //  },
   {
    path: '/class',
    name:'class',
    component:()=>import('../views/student/ClassView.vue')
   },
   {
    path: '/:classId/students',
    name: 'ClassStudents',
    component:()=>import('../views/student/ClassStudentView.vue')
  }

]

const router = new VueRouter({
  mode: 'history', // 使用 history 模式
  base: process.env.BASE_URL,
  routes
});

export default router
